package com.stackoverflow;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.TextView;

import com.stackoverflow.R;


public class AnswerList extends Activity implements OnClickListener {
	int questionId;
	ListItemGetter answerGetter;
	
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
	    setContentView(R.layout.answerlist);
	    
	    View nextButton = findViewById(R.id.ansnextpage);
        nextButton.setOnClickListener(this);
        
        View prevButton = findViewById(R.id.ansprevpage);
        prevButton.setOnClickListener(this);
        
        questionId = getIntent().getIntExtra("questionId", 0);
        TextView qText = (TextView) findViewById(R.id.questionText);
        String questionText = getIntent().getStringExtra("questionBody");
        qText.setText(questionText);
        
        answerGetter = new AnswerGetter(AnswerList.this, (ListView) findViewById(R.id.answerlistview), questionId);
        answerGetter.execute();
	}

	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
}
